{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "pycharm": {
     "is_executing": false
    }
   },
   "outputs": [],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.commons.utils import JsCode\n",
    "import pandas as pd\n",
    "from pyecharts.charts import Pie\n",
    "from pyecharts.charts import EffectScatter\n",
    "from pyecharts.globals import SymbolType\n",
    "from pyecharts.charts import Scatter3D\n",
    "from pyecharts.globals import ThemeType\n",
    "from pyecharts.charts import Radar\n",
    "from pyecharts.charts import Line"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 加载当前文件夹下的excel"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_excel('glory_new.xlsx')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 柱状图-英雄定位/数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d71304ea4c4241258a58b9b6d7d70171\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_d71304ea4c4241258a58b9b6d7d70171 = echarts.init(\n",
       "                    document.getElementById('d71304ea4c4241258a58b9b6d7d70171'), 'white', {renderer: 'canvas'});\n",
       "                var option_d71304ea4c4241258a58b9b6d7d70171 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u82f1\\u96c4\\u5b9a\\u4f4d\",\n",
       "            \"data\": [\n",
       "                28,\n",
       "                19,\n",
       "                16,\n",
       "                13,\n",
       "                11,\n",
       "                10\n",
       "            ],\n",
       "            \"barCategoryGap\": \"60%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"color\": new echarts.graphic.LinearGradient(0, 0, 0, 1, [{                    offset: 0,                    color: 'rgba(0, 244, 255, 1)'                }, {                    offset: 1,                    color: 'rgba(0, 77, 167, 1)'                }], false),\n",
       "                    \"barBorderRadius\": [\n",
       "                        30,\n",
       "                        30,\n",
       "                        30,\n",
       "                        30\n",
       "                    ],\n",
       "                    \"shadowColor\": \"rgb(0, 160, 221)\"\n",
       "                }\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u82f1\\u96c4\\u5b9a\\u4f4d\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u82f1\\u96c4\\u5b9a\\u4f4d\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u6cd5\\u5e08\",\n",
       "                \"\\u6218\\u58eb\",\n",
       "                \"\\u5766\\u514b\",\n",
       "                \"\\u5c04\\u624b\",\n",
       "                \"\\u8f85\\u52a9\",\n",
       "                \"\\u523a\\u5ba2\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u67f1\\u72b6\\u56fe-\\u82f1\\u96c4\\u5b9a\\u4f4d/\\u6570\\u91cf\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_d71304ea4c4241258a58b9b6d7d70171.setOption(option_d71304ea4c4241258a58b9b6d7d70171);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x120371240>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def bar_border_radius():\n",
    "    position_name = list(df['position'].value_counts().keys()) # 读取 position 列，分组计数，以定位分组\n",
    "    position_value = [v for k,v in df['position'].value_counts().items()] # 统计具体个数\n",
    "    c = (\n",
    "        Bar()\n",
    "        .add_xaxis(position_name)\n",
    "        .add_yaxis(\"英雄定位\", position_value, category_gap=\"60%\")\n",
    "        .set_series_opts(itemstyle_opts={\n",
    "            \"normal\": {\n",
    "                \"color\": JsCode(\"\"\"new echarts.graphic.LinearGradient(0, 0, 0, 1, [{\n",
    "                    offset: 0,\n",
    "                    color: 'rgba(0, 244, 255, 1)'\n",
    "                }, {\n",
    "                    offset: 1,\n",
    "                    color: 'rgba(0, 77, 167, 1)'\n",
    "                }], false)\"\"\"),\n",
    "                \"barBorderRadius\": [30, 30, 30, 30],\n",
    "                \"shadowColor\": 'rgb(0, 160, 221)',\n",
    "            }})\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"柱状图-英雄定位/数量\"))\n",
    "    )\n",
    "    return c\n",
    "\n",
    "bar_border_radius().render_notebook() # 初始化运行在notebook上。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 饼图/英雄定位"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"7ba7d7ca9ab549ec8ea860da7817d04f\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_7ba7d7ca9ab549ec8ea860da7817d04f = echarts.init(\n",
       "                    document.getElementById('7ba7d7ca9ab549ec8ea860da7817d04f'), 'white', {renderer: 'canvas'});\n",
       "                var option_7ba7d7ca9ab549ec8ea860da7817d04f = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u6cd5\\u5e08\",\n",
       "                    \"value\": 28\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6218\\u58eb\",\n",
       "                    \"value\": 19\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5766\\u514b\",\n",
       "                    \"value\": 16\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c04\\u624b\",\n",
       "                    \"value\": 13\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8f85\\u52a9\",\n",
       "                    \"value\": 11\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u523a\\u5ba2\",\n",
       "                    \"value\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"0%\",\n",
       "                \"75%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {c}\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u6cd5\\u5e08\",\n",
       "                \"\\u6218\\u58eb\",\n",
       "                \"\\u5766\\u514b\",\n",
       "                \"\\u5c04\\u624b\",\n",
       "                \"\\u8f85\\u52a9\",\n",
       "                \"\\u523a\\u5ba2\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u997c\\u56fe/\\u82f1\\u96c4\\u5b9a\\u4f4d\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_7ba7d7ca9ab549ec8ea860da7817d04f.setOption(option_7ba7d7ca9ab549ec8ea860da7817d04f);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1203716a0>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def pie_base() -> Pie:\n",
    "    position_name = list(df['position'].value_counts().keys()) # 读取 position 列，分组计数，以定位分组\n",
    "    position_value = [v for k,v in df['position'].value_counts().items()] # 统计具体个数\n",
    "    c = (\n",
    "        Pie()\n",
    "        .add(\"\", [list(z) for z in zip(position_name, position_value)])\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"饼图/英雄定位\"))\n",
    "        .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {c}\"))\n",
    "    )\n",
    "    return c\n",
    "pie_base().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 涟漪特效散点图-英雄移动速度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"ec72dad560b64f24ba91e8ca2bd97dae\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_ec72dad560b64f24ba91e8ca2bd97dae = echarts.init(\n",
       "                    document.getElementById('ec72dad560b64f24ba91e8ca2bd97dae'), 'white', {renderer: 'canvas'});\n",
       "                var option_ec72dad560b64f24ba91e8ca2bd97dae = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"effectScatter\",\n",
       "            \"showEffectOn\": \"render\",\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            },\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u66dc\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u897f\\u65bd\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e91\\u4e2d\\u541b\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5ae6\\u5a25\",\n",
       "                    395\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u76d8\\u53e4\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7476\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e0a\\u5b98\\u5a49\\u513f\",\n",
       "                    396\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6c88\\u68a6\\u6eaa\",\n",
       "                    396\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4f3d\\u7f57\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u76fe\\u5c71\",\n",
       "                    530\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7c73\\u83b1\\u72c4\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u53f8\\u9a6c\\u61ff\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u72c2\\u94c1\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u88f4\\u64d2\\u864e\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6768\\u7389\\u73af\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u516c\\u5b59\\u79bb\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5f08\\u661f\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u660e\\u4e16\\u9690\",\n",
       "                    340\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u68a6\\u5947\",\n",
       "                    530\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767e\\u91cc\\u7384\\u7b56\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u82cf\\u70c8\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767e\\u91cc\\u5b88\\u7ea6\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5143\\u6b4c\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5973\\u5a32\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9b3c\\u8c37\\u5b50\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e1c\\u7687\\u592a\\u4e00\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u94e0\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u827e\\u7433\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5927\\u4e54\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9ec4\\u5fe0\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8bf8\\u845b\\u4eae\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u54ea\\u5412\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u592a\\u4e59\\u771f\\u4eba\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6768\\u622c\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6210\\u5409\\u601d\\u6c57\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6a58\\u53f3\\u4eac\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9a6c\\u53ef\\u6ce2\\u7f57\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u96c5\\u5178\\u5a1c\",\n",
       "                    410\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u590f\\u4faf\\u60c7\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8521\\u6587\\u59ec\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5173\\u7fbd\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u865e\\u59ec\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e0d\\u77e5\\u706b\\u821e\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5218\\u90a6\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u674e\\u5143\\u82b3\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5f20\\u98de\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u949f\\u9997\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u540e\\u7fbf\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5218\\u5907\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9732\\u5a1c\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5bab\\u672c\\u6b66\\u85cf\",\n",
       "                    400\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u82b1\\u6728\\u5170\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5170\\u9675\\u738b\",\n",
       "                    400\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5a1c\\u53ef\\u9732\\u9732\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u674e\\u767d\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5468\\u745c\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8c82\\u8749\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5f20\\u826f\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u725b\\u9b54\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u66f9\\u64cd\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5b59\\u609f\\u7a7a\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5415\\u5e03\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767d\\u8d77\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u963f\\u8f72\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u58a8\\u5b50\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5ec9\\u9887\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8d75\\u4e91\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5b59\\u5c1a\\u9999\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u738b\\u662d\\u541b\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8fbe\\u6469\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5e84\\u5468\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6b66\\u5219\\u5929\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5b34\\u653f\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u949f\\u65e0\\u8273\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5b59\\u8191\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9879\\u7fbd\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7a0b\\u54ac\\u91d1\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u97e9\\u4fe1\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u72c4\\u4ec1\\u6770\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6241\\u9e4a\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5b89\\u742a\\u62c9\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5c0f\\u4e54\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u59b2\\u5df1\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8001\\u592b\\u5b50\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u4e9a\\u745f\",\n",
       "                    390\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5218\\u7985\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9c81\\u73ed\\u4e03\\u53f7\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7504\\u59ec\",\n",
       "                    360\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5178\\u97e6\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u59dc\\u5b50\\u7259\",\n",
       "                    350\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9ad8\\u6e10\\u79bb\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8288\\u6708\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5e72\\u5c06\\u83ab\\u90aa\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5b59\\u7b56\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u732a\\u516b\\u6212\",\n",
       "                    380\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9a6c\\u8d85\",\n",
       "                    370\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9c81\\u73ed\\u5927\\u5e08\",\n",
       "                    380\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u66dc\",\n",
       "                \"\\u897f\\u65bd\",\n",
       "                \"\\u4e91\\u4e2d\\u541b\",\n",
       "                \"\\u5ae6\\u5a25\",\n",
       "                \"\\u76d8\\u53e4\",\n",
       "                \"\\u7476\",\n",
       "                \"\\u4e0a\\u5b98\\u5a49\\u513f\",\n",
       "                \"\\u6c88\\u68a6\\u6eaa\",\n",
       "                \"\\u4f3d\\u7f57\",\n",
       "                \"\\u76fe\\u5c71\",\n",
       "                \"\\u7c73\\u83b1\\u72c4\",\n",
       "                \"\\u53f8\\u9a6c\\u61ff\",\n",
       "                \"\\u72c2\\u94c1\",\n",
       "                \"\\u88f4\\u64d2\\u864e\",\n",
       "                \"\\u6768\\u7389\\u73af\",\n",
       "                \"\\u516c\\u5b59\\u79bb\",\n",
       "                \"\\u5f08\\u661f\",\n",
       "                \"\\u660e\\u4e16\\u9690\",\n",
       "                \"\\u68a6\\u5947\",\n",
       "                \"\\u767e\\u91cc\\u7384\\u7b56\",\n",
       "                \"\\u82cf\\u70c8\",\n",
       "                \"\\u767e\\u91cc\\u5b88\\u7ea6\",\n",
       "                \"\\u5143\\u6b4c\",\n",
       "                \"\\u5973\\u5a32\",\n",
       "                \"\\u9b3c\\u8c37\\u5b50\",\n",
       "                \"\\u4e1c\\u7687\\u592a\\u4e00\",\n",
       "                \"\\u94e0\",\n",
       "                \"\\u827e\\u7433\",\n",
       "                \"\\u5927\\u4e54\",\n",
       "                \"\\u9ec4\\u5fe0\",\n",
       "                \"\\u8bf8\\u845b\\u4eae\",\n",
       "                \"\\u54ea\\u5412\",\n",
       "                \"\\u592a\\u4e59\\u771f\\u4eba\",\n",
       "                \"\\u6768\\u622c\",\n",
       "                \"\\u6210\\u5409\\u601d\\u6c57\",\n",
       "                \"\\u6a58\\u53f3\\u4eac\",\n",
       "                \"\\u9a6c\\u53ef\\u6ce2\\u7f57\",\n",
       "                \"\\u96c5\\u5178\\u5a1c\",\n",
       "                \"\\u590f\\u4faf\\u60c7\",\n",
       "                \"\\u8521\\u6587\\u59ec\",\n",
       "                \"\\u5173\\u7fbd\",\n",
       "                \"\\u865e\\u59ec\",\n",
       "                \"\\u4e0d\\u77e5\\u706b\\u821e\",\n",
       "                \"\\u5218\\u90a6\",\n",
       "                \"\\u674e\\u5143\\u82b3\",\n",
       "                \"\\u5f20\\u98de\",\n",
       "                \"\\u949f\\u9997\",\n",
       "                \"\\u540e\\u7fbf\",\n",
       "                \"\\u5218\\u5907\",\n",
       "                \"\\u9732\\u5a1c\",\n",
       "                \"\\u5bab\\u672c\\u6b66\\u85cf\",\n",
       "                \"\\u82b1\\u6728\\u5170\",\n",
       "                \"\\u5170\\u9675\\u738b\",\n",
       "                \"\\u5a1c\\u53ef\\u9732\\u9732\",\n",
       "                \"\\u674e\\u767d\",\n",
       "                \"\\u5468\\u745c\",\n",
       "                \"\\u8c82\\u8749\",\n",
       "                \"\\u5f20\\u826f\",\n",
       "                \"\\u725b\\u9b54\",\n",
       "                \"\\u66f9\\u64cd\",\n",
       "                \"\\u5b59\\u609f\\u7a7a\",\n",
       "                \"\\u5415\\u5e03\",\n",
       "                \"\\u767d\\u8d77\",\n",
       "                \"\\u963f\\u8f72\",\n",
       "                \"\\u58a8\\u5b50\",\n",
       "                \"\\u5ec9\\u9887\",\n",
       "                \"\\u8d75\\u4e91\",\n",
       "                \"\\u5b59\\u5c1a\\u9999\",\n",
       "                \"\\u738b\\u662d\\u541b\",\n",
       "                \"\\u8fbe\\u6469\",\n",
       "                \"\\u5e84\\u5468\",\n",
       "                \"\\u6b66\\u5219\\u5929\",\n",
       "                \"\\u5b34\\u653f\",\n",
       "                \"\\u949f\\u65e0\\u8273\",\n",
       "                \"\\u5b59\\u8191\",\n",
       "                \"\\u9879\\u7fbd\",\n",
       "                \"\\u7a0b\\u54ac\\u91d1\",\n",
       "                \"\\u97e9\\u4fe1\",\n",
       "                \"\\u72c4\\u4ec1\\u6770\",\n",
       "                \"\\u6241\\u9e4a\",\n",
       "                \"\\u5b89\\u742a\\u62c9\",\n",
       "                \"\\u5c0f\\u4e54\",\n",
       "                \"\\u59b2\\u5df1\",\n",
       "                \"\\u8001\\u592b\\u5b50\",\n",
       "                \"\\u4e9a\\u745f\",\n",
       "                \"\\u5218\\u7985\",\n",
       "                \"\\u9c81\\u73ed\\u4e03\\u53f7\",\n",
       "                \"\\u7504\\u59ec\",\n",
       "                \"\\u5178\\u97e6\",\n",
       "                \"\\u59dc\\u5b50\\u7259\",\n",
       "                \"\\u9ad8\\u6e10\\u79bb\",\n",
       "                \"\\u8288\\u6708\",\n",
       "                \"\\u5e72\\u5c06\\u83ab\\u90aa\",\n",
       "                \"\\u5b59\\u7b56\",\n",
       "                \"\\u732a\\u516b\\u6212\",\n",
       "                \"\\u9a6c\\u8d85\",\n",
       "                \"\\u9c81\\u73ed\\u5927\\u5e08\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6d9f\\u6f2a\\u7279\\u6548\\u6563\\u70b9\\u56fe-\\u82f1\\u96c4\\u79fb\\u52a8\\u901f\\u5ea6\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_ec72dad560b64f24ba91e8ca2bd97dae.setOption(option_ec72dad560b64f24ba91e8ca2bd97dae);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x11c7a6fd0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def effectscatter_base() -> EffectScatter:\n",
    "    c = (\n",
    "        EffectScatter()\n",
    "        .add_xaxis(list(df['name']))\n",
    "        .add_yaxis(\"\", list(df['移速']))\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"涟漪特效散点图-英雄移动速度\"))\n",
    "    )\n",
    "    return c\n",
    "effectscatter_base().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 柱状图-英雄/最大生命值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"6d6ca3f328b84215acc477f3c5cfd587\" style=\"width:1024px; height:768px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_6d6ca3f328b84215acc477f3c5cfd587 = echarts.init(\n",
       "                    document.getElementById('6d6ca3f328b84215acc477f3c5cfd587'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_6d6ca3f328b84215acc477f3c5cfd587 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5766\\u514b\",\n",
       "            \"data\": [\n",
       "                3369,\n",
       "                3201,\n",
       "                3307,\n",
       "                3369,\n",
       "                3450,\n",
       "                3537,\n",
       "                3510,\n",
       "                3558,\n",
       "                3150,\n",
       "                3535,\n",
       "                3437,\n",
       "                3622,\n",
       "                3364,\n",
       "                3237,\n",
       "                3067,\n",
       "                3287\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5766\\u514b\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5766\\u514b\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u82cf\\u70c8\",\n",
       "                \"\\u4e1c\\u7687\\u592a\\u4e00\",\n",
       "                \"\\u590f\\u4faf\\u60c7\",\n",
       "                \"\\u5218\\u90a6\",\n",
       "                \"\\u5f20\\u98de\",\n",
       "                \"\\u725b\\u9b54\",\n",
       "                \"\\u767d\\u8d77\",\n",
       "                \"\\u5ec9\\u9887\",\n",
       "                \"\\u949f\\u65e0\\u8273\",\n",
       "                \"\\u9879\\u7fbd\",\n",
       "                \"\\u7a0b\\u54ac\\u91d1\",\n",
       "                \"\\u4e9a\\u745f\",\n",
       "                \"\\u5218\\u7985\",\n",
       "                \"\\u5b59\\u7b56\",\n",
       "                \"\\u732a\\u516b\\u6212\",\n",
       "                \"\\u9c81\\u73ed\\u5927\\u5e08\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u67f1\\u72b6\\u56fe-\\u82f1\\u96c4/\\u6700\\u5927\\u751f\\u547d\\u503c\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_6d6ca3f328b84215acc477f3c5cfd587.setOption(option_6d6ca3f328b84215acc477f3c5cfd587);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x120318c18>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def bar_base_dict_config() -> Bar:\n",
    "    tk_name = list(df[df['position']=='坦克']['name']) # 获取等于坦克的英雄名称\n",
    "    tk_list = list(df[df['position']=='坦克']['最大生命']) # 获取等于坦克的最大生命\n",
    "    c = (\n",
    "        Bar({\"theme\": ThemeType.MACARONS,\"width\": \"1024px\", \"height\": \"768px\"})\n",
    "        .add_xaxis(tk_name)\n",
    "        .add_yaxis(\"坦克\", tk_list, category_gap=\"20%\")\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"柱状图-英雄/最大生命值\"),datazoom_opts=opts.DataZoomOpts())\n",
    "    )\n",
    "    return c\n",
    "bar_base_dict_config().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 坦克生命值平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"858fb0d21a9943eb8357002f85e2d4a8\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_858fb0d21a9943eb8357002f85e2d4a8 = echarts.init(\n",
       "                    document.getElementById('858fb0d21a9943eb8357002f85e2d4a8'), 'white', {renderer: 'canvas'});\n",
       "                var option_858fb0d21a9943eb8357002f85e2d4a8 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u751f\\u547d\\u503c\",\n",
       "            \"data\": [\n",
       "                3369,\n",
       "                3201,\n",
       "                3307,\n",
       "                3369,\n",
       "                3450,\n",
       "                3537,\n",
       "                3510,\n",
       "                3558,\n",
       "                3150,\n",
       "                3535,\n",
       "                3437,\n",
       "                3622,\n",
       "                3364,\n",
       "                3237,\n",
       "                3067,\n",
       "                3287\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"data\": [\n",
       "                    {\n",
       "                        \"name\": \"yAxis=50\",\n",
       "                        \"type\": \"average\",\n",
       "                        \"yAxis\": 3188.907216494845\n",
       "                    }\n",
       "                ]\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {\n",
       "                    \"color\": new echarts.graphic.LinearGradient(0, 0, 0, 1, [{                    offset: 0,                    color: 'rgba(221,160,221, 1)'                }, {                    offset: 1,                    color: 'rgba(255,0,255, 1)'                }], false),\n",
       "                    \"barBorderRadius\": [\n",
       "                        30,\n",
       "                        30,\n",
       "                        30,\n",
       "                        30\n",
       "                    ],\n",
       "                    \"shadowColor\": \"rgb(0, 160, 221)\"\n",
       "                }\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u751f\\u547d\\u503c\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u751f\\u547d\\u503c\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u82cf\\u70c8\",\n",
       "                \"\\u4e1c\\u7687\\u592a\\u4e00\",\n",
       "                \"\\u590f\\u4faf\\u60c7\",\n",
       "                \"\\u5218\\u90a6\",\n",
       "                \"\\u5f20\\u98de\",\n",
       "                \"\\u725b\\u9b54\",\n",
       "                \"\\u767d\\u8d77\",\n",
       "                \"\\u5ec9\\u9887\",\n",
       "                \"\\u949f\\u65e0\\u8273\",\n",
       "                \"\\u9879\\u7fbd\",\n",
       "                \"\\u7a0b\\u54ac\\u91d1\",\n",
       "                \"\\u4e9a\\u745f\",\n",
       "                \"\\u5218\\u7985\",\n",
       "                \"\\u5b59\\u7b56\",\n",
       "                \"\\u732a\\u516b\\u6212\",\n",
       "                \"\\u9c81\\u73ed\\u5927\\u5e08\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u82f1\\u96c4/\\u751f\\u547d\\u503c\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_858fb0d21a9943eb8357002f85e2d4a8.setOption(option_858fb0d21a9943eb8357002f85e2d4a8);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x120370ac8>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def bar_markline_custom() -> Bar:\n",
    "    x_data = list(df[df['position']=='坦克']['name'])\n",
    "    y_data = list(df[df['position']=='坦克']['最大生命'])\n",
    "    y_mean = df['最大生命'].mean()\n",
    "\n",
    "    c = (\n",
    "        Bar()\n",
    "        .add_xaxis(x_data)\n",
    "        .add_yaxis(\"生命值\", y_data)\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"英雄/生命值\"),datazoom_opts=opts.DataZoomOpts())\n",
    "        .set_series_opts(\n",
    "            itemstyle_opts={\n",
    "            \"normal\": {\n",
    "                \"color\": JsCode(\"\"\"new echarts.graphic.LinearGradient(0, 0, 0, 1, [{\n",
    "                    offset: 0,\n",
    "                    color: 'rgba(221,160,221, 1)'\n",
    "                }, {\n",
    "                    offset: 1,\n",
    "                    color: 'rgba(255,0,255, 1)'\n",
    "                }], false)\"\"\"),\n",
    "                \"barBorderRadius\": [30, 30, 30, 30],\n",
    "                \"shadowColor\": 'rgb(0, 160, 221)',\n",
    "            }},\n",
    "            label_opts=opts.LabelOpts(is_show=False),\n",
    "            markline_opts=opts.MarkLineOpts(\n",
    "                data=[opts.MarkLineItem(y=y_mean, name=\"yAxis=50\",type_='average')]\n",
    "            ),\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "bar_markline_custom().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 柱状图-英雄/防御值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"93411488a16c431894f8ce8cfc590fd1\" style=\"width:1024px; height:768px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_93411488a16c431894f8ce8cfc590fd1 = echarts.init(\n",
       "                    document.getElementById('93411488a16c431894f8ce8cfc590fd1'), 'white', {renderer: 'canvas'});\n",
       "                var option_93411488a16c431894f8ce8cfc590fd1 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#ca8622\",\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u7269\\u7406\\u9632\\u5fa1\",\n",
       "            \"data\": [\n",
       "                94,\n",
       "                91,\n",
       "                99,\n",
       "                79,\n",
       "                99,\n",
       "                87,\n",
       "                79,\n",
       "                87,\n",
       "                84,\n",
       "                79,\n",
       "                91,\n",
       "                91,\n",
       "                95,\n",
       "                99,\n",
       "                96,\n",
       "                91,\n",
       "                93,\n",
       "                86,\n",
       "                79,\n",
       "                88,\n",
       "                93,\n",
       "                86,\n",
       "                89,\n",
       "                93,\n",
       "                87,\n",
       "                90,\n",
       "                84,\n",
       "                86,\n",
       "                93,\n",
       "                91,\n",
       "                87,\n",
       "                99,\n",
       "                94,\n",
       "                98,\n",
       "                94,\n",
       "                96,\n",
       "                91,\n",
       "                106,\n",
       "                101,\n",
       "                96,\n",
       "                101,\n",
       "                84,\n",
       "                89,\n",
       "                125,\n",
       "                87,\n",
       "                125,\n",
       "                99,\n",
       "                86,\n",
       "                88,\n",
       "                102,\n",
       "                106,\n",
       "                86,\n",
       "                85,\n",
       "                86,\n",
       "                98,\n",
       "                87,\n",
       "                87,\n",
       "                87,\n",
       "                109,\n",
       "                104,\n",
       "                98,\n",
       "                99,\n",
       "                120,\n",
       "                89,\n",
       "                102,\n",
       "                132,\n",
       "                84,\n",
       "                89,\n",
       "                91,\n",
       "                95,\n",
       "                150,\n",
       "                95,\n",
       "                91,\n",
       "                100,\n",
       "                98,\n",
       "                123,\n",
       "                125,\n",
       "                92,\n",
       "                95,\n",
       "                87,\n",
       "                83,\n",
       "                95,\n",
       "                86,\n",
       "                100,\n",
       "                98,\n",
       "                139,\n",
       "                88,\n",
       "                87,\n",
       "                89,\n",
       "                106,\n",
       "                98,\n",
       "                88,\n",
       "                92,\n",
       "                97,\n",
       "                99,\n",
       "                96,\n",
       "                127\n",
       "            ],\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7269\\u7406\\u9632\\u5fa1\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u7269\\u7406\\u9632\\u5fa1\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u66dc\",\n",
       "                \"\\u897f\\u65bd\",\n",
       "                \"\\u4e91\\u4e2d\\u541b\",\n",
       "                \"\\u5ae6\\u5a25\",\n",
       "                \"\\u76d8\\u53e4\",\n",
       "                \"\\u7476\",\n",
       "                \"\\u4e0a\\u5b98\\u5a49\\u513f\",\n",
       "                \"\\u6c88\\u68a6\\u6eaa\",\n",
       "                \"\\u4f3d\\u7f57\",\n",
       "                \"\\u76fe\\u5c71\",\n",
       "                \"\\u7c73\\u83b1\\u72c4\",\n",
       "                \"\\u53f8\\u9a6c\\u61ff\",\n",
       "                \"\\u72c2\\u94c1\",\n",
       "                \"\\u88f4\\u64d2\\u864e\",\n",
       "                \"\\u6768\\u7389\\u73af\",\n",
       "                \"\\u516c\\u5b59\\u79bb\",\n",
       "                \"\\u5f08\\u661f\",\n",
       "                \"\\u660e\\u4e16\\u9690\",\n",
       "                \"\\u68a6\\u5947\",\n",
       "                \"\\u767e\\u91cc\\u7384\\u7b56\",\n",
       "                \"\\u82cf\\u70c8\",\n",
       "                \"\\u767e\\u91cc\\u5b88\\u7ea6\",\n",
       "                \"\\u5143\\u6b4c\",\n",
       "                \"\\u5973\\u5a32\",\n",
       "                \"\\u9b3c\\u8c37\\u5b50\",\n",
       "                \"\\u4e1c\\u7687\\u592a\\u4e00\",\n",
       "                \"\\u94e0\",\n",
       "                \"\\u827e\\u7433\",\n",
       "                \"\\u5927\\u4e54\",\n",
       "                \"\\u9ec4\\u5fe0\",\n",
       "                \"\\u8bf8\\u845b\\u4eae\",\n",
       "                \"\\u54ea\\u5412\",\n",
       "                \"\\u592a\\u4e59\\u771f\\u4eba\",\n",
       "                \"\\u6768\\u622c\",\n",
       "                \"\\u6210\\u5409\\u601d\\u6c57\",\n",
       "                \"\\u6a58\\u53f3\\u4eac\",\n",
       "                \"\\u9a6c\\u53ef\\u6ce2\\u7f57\",\n",
       "                \"\\u96c5\\u5178\\u5a1c\",\n",
       "                \"\\u590f\\u4faf\\u60c7\",\n",
       "                \"\\u8521\\u6587\\u59ec\",\n",
       "                \"\\u5173\\u7fbd\",\n",
       "                \"\\u865e\\u59ec\",\n",
       "                \"\\u4e0d\\u77e5\\u706b\\u821e\",\n",
       "                \"\\u5218\\u90a6\",\n",
       "                \"\\u674e\\u5143\\u82b3\",\n",
       "                \"\\u5f20\\u98de\",\n",
       "                \"\\u949f\\u9997\",\n",
       "                \"\\u540e\\u7fbf\",\n",
       "                \"\\u5218\\u5907\",\n",
       "                \"\\u9732\\u5a1c\",\n",
       "                \"\\u5bab\\u672c\\u6b66\\u85cf\",\n",
       "                \"\\u82b1\\u6728\\u5170\",\n",
       "                \"\\u5170\\u9675\\u738b\",\n",
       "                \"\\u5a1c\\u53ef\\u9732\\u9732\",\n",
       "                \"\\u674e\\u767d\",\n",
       "                \"\\u5468\\u745c\",\n",
       "                \"\\u8c82\\u8749\",\n",
       "                \"\\u5f20\\u826f\",\n",
       "                \"\\u725b\\u9b54\",\n",
       "                \"\\u66f9\\u64cd\",\n",
       "                \"\\u5b59\\u609f\\u7a7a\",\n",
       "                \"\\u5415\\u5e03\",\n",
       "                \"\\u767d\\u8d77\",\n",
       "                \"\\u963f\\u8f72\",\n",
       "                \"\\u58a8\\u5b50\",\n",
       "                \"\\u5ec9\\u9887\",\n",
       "                \"\\u8d75\\u4e91\",\n",
       "                \"\\u5b59\\u5c1a\\u9999\",\n",
       "                \"\\u738b\\u662d\\u541b\",\n",
       "                \"\\u8fbe\\u6469\",\n",
       "                \"\\u5e84\\u5468\",\n",
       "                \"\\u6b66\\u5219\\u5929\",\n",
       "                \"\\u5b34\\u653f\",\n",
       "                \"\\u949f\\u65e0\\u8273\",\n",
       "                \"\\u5b59\\u8191\",\n",
       "                \"\\u9879\\u7fbd\",\n",
       "                \"\\u7a0b\\u54ac\\u91d1\",\n",
       "                \"\\u97e9\\u4fe1\",\n",
       "                \"\\u72c4\\u4ec1\\u6770\",\n",
       "                \"\\u6241\\u9e4a\",\n",
       "                \"\\u5b89\\u742a\\u62c9\",\n",
       "                \"\\u5c0f\\u4e54\",\n",
       "                \"\\u59b2\\u5df1\",\n",
       "                \"\\u8001\\u592b\\u5b50\",\n",
       "                \"\\u4e9a\\u745f\",\n",
       "                \"\\u5218\\u7985\",\n",
       "                \"\\u9c81\\u73ed\\u4e03\\u53f7\",\n",
       "                \"\\u7504\\u59ec\",\n",
       "                \"\\u5178\\u97e6\",\n",
       "                \"\\u59dc\\u5b50\\u7259\",\n",
       "                \"\\u9ad8\\u6e10\\u79bb\",\n",
       "                \"\\u8288\\u6708\",\n",
       "                \"\\u5e72\\u5c06\\u83ab\\u90aa\",\n",
       "                \"\\u5b59\\u7b56\",\n",
       "                \"\\u732a\\u516b\\u6212\",\n",
       "                \"\\u9a6c\\u8d85\",\n",
       "                \"\\u9c81\\u73ed\\u5927\\u5e08\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u67f1\\u72b6\\u56fe-\\u82f1\\u96c4/\\u9632\\u5fa1\\u503c\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"slider\",\n",
       "        \"realtime\": true,\n",
       "        \"start\": 20,\n",
       "        \"end\": 80,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"zoomLock\": false\n",
       "    }\n",
       "};\n",
       "                chart_93411488a16c431894f8ce8cfc590fd1.setOption(option_93411488a16c431894f8ce8cfc590fd1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x120370d68>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def bar_base() -> Bar:\n",
    "    c = (\n",
    "        Bar({\"width\": \"1024px\", \"height\": \"768px\"})\n",
    "        .add_xaxis(list(df['name']))\n",
    "        .add_yaxis(\"物理防御\",list(df['物理防御']),color=Faker.rand_color())\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"柱状图-英雄/防御值\"),datazoom_opts=opts.DataZoomOpts())\n",
    "    )\n",
    "    return c\n",
    "bar_base().render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 雷达图-英雄推荐"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['法师', '战士', '坦克', '射手', '辅助', '刺客']\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e7332384de5944d78b30eb2631f9b774\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_e7332384de5944d78b30eb2631f9b774 = echarts.init(\n",
       "                    document.getElementById('e7332384de5944d78b30eb2631f9b774'), 'white', {renderer: 'canvas'});\n",
       "                var option_e7332384de5944d78b30eb2631f9b774 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"radar\",\n",
       "            \"name\": \"\\u523a\\u5ba2\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    6,\n",
       "                    9,\n",
       "                    5,\n",
       "                    5,\n",
       "                    \"\\u4e91\\u4e2d\\u541b\"\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    8,\n",
       "                    6,\n",
       "                    9,\n",
       "                    \"\\u88f4\\u64d2\\u864e\"\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    8,\n",
       "                    8,\n",
       "                    10,\n",
       "                    \"\\u767e\\u91cc\\u7384\\u7b56\"\n",
       "                ],\n",
       "                [\n",
       "                    4,\n",
       "                    6,\n",
       "                    4,\n",
       "                    4,\n",
       "                    \"\\u5143\\u6b4c\"\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    10,\n",
       "                    4,\n",
       "                    6,\n",
       "                    \"\\u5170\\u9675\\u738b\"\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    7,\n",
       "                    6,\n",
       "                    5,\n",
       "                    \"\\u5a1c\\u53ef\\u9732\\u9732\"\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    6,\n",
       "                    8,\n",
       "                    6,\n",
       "                    \"\\u674e\\u767d\"\n",
       "                ],\n",
       "                [\n",
       "                    5,\n",
       "                    5,\n",
       "                    5,\n",
       "                    4,\n",
       "                    \"\\u5b59\\u609f\\u7a7a\"\n",
       "                ],\n",
       "                [\n",
       "                    2,\n",
       "                    10,\n",
       "                    4,\n",
       "                    6,\n",
       "                    \"\\u963f\\u8f72\"\n",
       "                ],\n",
       "                [\n",
       "                    3,\n",
       "                    6,\n",
       "                    8,\n",
       "                    8,\n",
       "                    \"\\u97e9\\u4fe1\"\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"itemStyle\": {\n",
       "                \"normal\": {}\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u523a\\u5ba2\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u523a\\u5ba2\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"radar\": {\n",
       "        \"indicator\": [\n",
       "            {\n",
       "                \"name\": \"\\u751f\\u5b58\\u80fd\\u529b\",\n",
       "                \"max\": 10\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u653b\\u51fb\\u4f24\\u5bb3\",\n",
       "                \"max\": 10\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u6280\\u80fd\\u6548\\u679c\",\n",
       "                \"max\": 10\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u4e0a\\u624b\\u96be\\u5ea6\",\n",
       "                \"max\": 10\n",
       "            },\n",
       "            {\n",
       "                \"name\": \"\\u82f1\\u96c4\\u540d\\u79f0\",\n",
       "                \"max\": 10\n",
       "            }\n",
       "        ],\n",
       "        \"shape\": \"circle\",\n",
       "        \"name\": {\n",
       "            \"textStyle\": {}\n",
       "        },\n",
       "        \"splitLine\": {\n",
       "            \"show\": true,\n",
       "            \"lineStyle\": {\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            }\n",
       "        },\n",
       "        \"splitArea\": {\n",
       "            \"show\": true,\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            }\n",
       "        },\n",
       "        \"axisLine\": {\n",
       "            \"show\": true,\n",
       "            \"onZero\": true,\n",
       "            \"onZeroAxisIndex\": 0\n",
       "        }\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u96f7\\u8fbe\\u56fe-\\u82f1\\u96c4\\u63a8\\u8350\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_e7332384de5944d78b30eb2631f9b774.setOption(option_e7332384de5944d78b30eb2631f9b774);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x120365160>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def radar_base(name=None) -> Radar:\n",
    "    # 如果外面传入职位，则直接替换\n",
    "    if name:\n",
    "        new_df = df[df['position']==name]\n",
    "    else:\n",
    "        new_df = df\n",
    "        name = '英雄'\n",
    "    data = [[a,b,c,d,e] for a,b,c,d,e in zip(list(new_df['生存能力']), list(new_df['攻击伤害']),\n",
    "                                         list(new_df['技能效果']), list(new_df['上手难度']),\n",
    "                                         list(new_df['name']))]\n",
    "    \n",
    "    c = (\n",
    "        Radar()\n",
    "        .add_schema(\n",
    "            schema=[\n",
    "                opts.RadarIndicatorItem(name=\"生存能力\", max_=10),\n",
    "                opts.RadarIndicatorItem(name=\"攻击伤害\", max_=10),\n",
    "                opts.RadarIndicatorItem(name=\"技能效果\", max_=10),\n",
    "                opts.RadarIndicatorItem(name=\"上手难度\", max_=10),\n",
    "                opts.RadarIndicatorItem(name=\"英雄名称\", max_=10)\n",
    "            ]\n",
    "            , shape=\"circle\",\n",
    "            \n",
    "        )\n",
    "        .add(name, data)\n",
    "        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"雷达图-英雄推荐\"))\n",
    "    )\n",
    "    return c\n",
    "print(list(df['position'].value_counts().keys())) # 打印全位置\n",
    "radar_base('刺客').render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}